AjaxTable.AjaxTableComponent.prototype.creatRoot = function() {
	var doc;
    if(window.DOMParser){  
		doc = new DOMParser();
	}else if(window.ActiveXObject){  
		doc = new ActiveXObject("Msxml2.DOMDocument");  
	}
	var header = doc.createProcessingInstruction("xml","version='1.0'  encoding='utf-8'");
	doc.appendChild(header);
	return doc;
};
AjaxTable.AjaxTableComponent.prototype.createXmlRkxt = function(data) {
	var keys = this.logicParmeters.get("all");
	var doc;
    if(window.DOMParser){  
		doc = new DOMParser();
	}else if(window.ActiveXObject){  
		doc = new ActiveXObject("Msxml2.DOMDocument");  
	}
	var header = doc.createProcessingInstruction("xml","version='1.0'  encoding='utf-8'");
	doc.appendChild(header);
	var xmlRoot = doc.createElement("list");
	var rootKey = doc.createAttribute("key");
	rootKey.value = this.id;
	xmlRoot.setAttributeNode(rootKey);
	for(var i = 0; i < data.length; i++) {
		var mapRoot = doc.createElement("map");
		xmlRoot.appendChild(mapRoot);
		for(var j = 0; j < keys.length - 1; j++) {
			var valueRoot = doc.createElement("value");
			mapRoot.appendChild(valueRoot);
			var valueKey = doc.createAttribute("key");
			valueKey.value = keys[j];
			valueRoot.setAttributeNode(valueKey);
			if(data[i].get(keys[j]) != null && data[i].get(keys[j]) != "") {
				valueRoot.text = data[i].get(keys[j]) ;
			} else {
				valueRoot.text = ""
			}
		}
	}
	return xmlRoot;//this.creatXML(xmlRoot);
};
AjaxTable.AjaxTableComponent.prototype.addDataOfMap = function(map) {
	this.addMap(map) ;
};
AjaxTable.AjaxTableComponent.prototype.removeAll = function() {
	this.helper.data.length = 0 ;
	this.showCustemData() ;
};
AjaxTable.AjaxTableComponent.prototype.getAllData = function(key) {
	var listOfKey = new Array() ;
    var datas = this.getDatas() ;
    for(var i = 0; i < datas.length; i++) {
   	    listOfKey.push(datas[i].get(key)) ;
    }
    return listOfKey;
};
AjaxTable.AjaxTableComponent.prototype.getXmlFromString = function(str) {
	if(window.DOMParser){  
		var p = new DOMParser();
		return p.parseFromString(str,"text/xml");  
	}else if(window.ActiveXObject){  
		var doc = new ActiveXObject("Msxml2.DOMDocument");  
		doc.loadXML(str); 
		return doc;  
	}else{
		return false;  
	}
};
AjaxTable.AjaxTableComponent.prototype.getKeys = function() {
	return this.getFields() ;
};
AjaxTable.AjaxTableComponent.prototype.getXmlOfAllData = function() {
	return this.createXmlRkxt(this.getDatas());//this.getAllDataXMLDatas() ;
};
AjaxTable.AjaxTableComponent.prototype.getXmlOfUpdateModel = function() {
	return this.createXmlRkxt(this.updateDatas);//this.getUpdateXMLDatas();
};
AjaxTable.AjaxTableComponent.prototype.getXmlOfRemoveModel = function() {
	return this.getRemoveXMLDatas() ;
};
AjaxTable.AjaxTableComponent.prototype.getRowValues = function() {
	return this.getDatas()[clickNumber.get(this.id)] ;
};
AjaxTable.AjaxTableComponent.prototype.removeCheck = function() {
	this.removeChecked();
};
AjaxTable.AjaxTableComponent.prototype.addMuchData = function(xmlDoc) {
	this.addXML(xmlDoc);
};
AjaxTable.AjaxTableComponent.prototype.getCheckChooseValues = function() {
	this.initCheckedNumbers();
	var checkedDatas = new Array() ;
    var index = 0 ;
	for(var i = 0; i < this.checkedNumbers.length; i++) {
		index = this.checkedNumbers[i] ;
		checkedDatas.push(this.getRowDatas(index)) ;
	}
	return checkedDatas;
};
AjaxTable.AjaxTableComponent.prototype.getXmlOfAllCheck = function() {
	return this.getAllCheckedDataXMLDatas();
};
AjaxTable.AjaxTableComponent.prototype.getXmlOfRowValues = function() {
	return this.createXmlRkxt([this.getRowValues()]);
};
function upOrDownOfAll(table1,table2){
    if(table1.getDatas()[0]){
    	table2.add(table1.getXmlOfAllData());
	    for(var i=dataSet.length-1; i>=0; i--){
	        table1.removeDataOfRow(i);
	    }
	    table1.showCustemData();
    }else{
        alert("表格中没有数据");
    }
};
//将table1选中的数据放到table2中
function upOrDown(table1,table2){
    if(table1.getDatas()){
        if(table1.getDatas()[0]){
        	var datas = table1.getRowValues();
        	if(datas){
		        table2.add(table1.createXmlRkxt([table1.getRowValues()]));
		    }
		    table1.remove();
	    }
    }else{
        alert("表格中没有数据");
    }
};




















